home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Skunkware 5
/
Skunkware 5.iso
/
src
/
X11
/
xsw
/
devstats.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-09
|
25KB
|
608 lines
/***************************************************************************
*
* Copyright (c) 1990-1993 The Santa Cruz Operation, Inc.
*
* All rights reserved. No part of this program or publication may be
* reproduced, transmitted, transcribed, stored in a retrieval system,
* or translated into any language or computer language, in any form or
* by any means, electronic, mechanical, magnetic, optical, chemical,
* biological, or otherwise, without the prior written permission of:
*
* The Santa Cruz Operation , Inc. (408) 425-7222
* 400 Encinal St., Santa Cruz, California 95060 USA
*
**************************************************************************/
/*
*
* SCCS Stuff
*
* @(#) devstats.c 12.1 95/05/09 SCOINC
*
* S002, 25-May-93, rickra
* Added support for IDE drives, and reformatted the source.....
*
* S001, 01-Jan-93, rickra
* Added support for seperate windows.
*
* S000, 30-Sep-92, rickra
* Added copyright and modification history.
* Changed reference to hard coded colors to user configurable colors.
*/
/*+-------------------------------------------------------------------------
devstats.c - XSW streams display handler
Defined functions:
draw_dev_stats_literals(x,y)
update_dev_stats()
--------------------------------------------------------------------------*/
/*+:EDITS:*/
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Intrinsic.h>
#include <X11/Shell.h>
#include <Xm/Xm.h>
#include <Xm/MainW.h>
#include <Xm/DrawingA.h>
#include "include/unixincs.h"
#include "include/buttons.h"
#include "include/xsw.h"
extern struct NetworkXswStruct *current_server;
int devstats_tlx;
int devstats_tly;
int
count_active_devices (new_devices, old_devices /* ,num_of_items */ )
struct iotime *new_devices;
struct iotime *old_devices;
/*
int num_of_itmes;*/
{
int i;
int active_count = 0;
for (i = 0; i < 4; i++)
if (((new_devices[i].io_cnt - old_devices[i].io_cnt) > 0) &&
((new_devices[i].io_act - old_devices[i].io_act) > 0))
active_count++;
return (active_count);
}
/*+-------------------------------------------------------------------------
update_dev_stats()
--------------------------------------------------------------------------*/
void
update_dev_stats (SP)
struct NetworkXswStruct *SP;
{
Window window = SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].window;
Display *display = SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].display;
GC gc = SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].gc;
XWindowAttributes DrawAreaXYWH = SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].DrawAreaXYWH;
Pixmap pixmap = SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].pixmap;
register int x, y;
int fheight = FHEIGHT;
int w;
float busy;
float time_window;
int dblk_tot_config;
y = devstats_tly + fheight;
x = devstats_tlx;
/*
XClearArea (display, window, x, y,
DrawAreaXYWH.width - x, FHEIGHT * (current_server -> COMMAND_LIST[BUTTON_dev_stats].Y_mult - 1), 0);
*/
XSetForeground (display, gc, background);
/*
XFillRectangle (display, pixmap, gc, x, y,SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].width -x, FHEIGHT * SP -> COMMAND_LIST[BUTTON_dev_stats].Y_mult - 1);
*/
XFillRectangle (display, pixmap, gc, x, y, SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].width - x, FHEIGHT * SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].height - 1);
if (current_server -> got_scsi_disk_stats)
{
for (w = 0; w < 4; w++)
{
if (((current_server -> Sdsk_stats[w].io_cnt - current_server -> old_Sdsk_stats[w].io_cnt) > 0) &&
((current_server -> Sdsk_stats[w].io_act - current_server -> old_Sdsk_stats[w].io_act) > 0))
{
busy = (float) (current_server -> Sdsk_stats[w].io_act - current_server -> old_Sdsk_stats[w].io_act) /
(current_server -> StatPeriod_msec * current_server -> hz / 1000) * 100.0;
if (busy > 100.0)
busy = 100.0;
time_window = (current_server -> StatPeriod_msec / 1000);
if (time_window <= 0)
time_window = 1;
x = devstats_tlx;
disp_info_text (window, display, gc, DrawAreaXYWH, x, y, pixmap, colorLabel.pixel, "Sdsk-");
x += (FWIDTH * 8);
disp_long (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%2d", colorNumeric.pixel, w);
x += (FWIDTH * 5);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel, busy);
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (current_server -> Sdsk_stats[w].io_resp - current_server -> old_Sdsk_stats[w].io_resp) /
(float) (current_server -> Sdsk_stats[w].io_act - current_server -> old_Sdsk_stats[w].io_act));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (current_server -> Sdsk_stats[w].io_cnt - current_server -> old_Sdsk_stats[w].io_cnt) /
(time_window));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (ctod (current_server -> Sdsk_stats[w].io_bcnt - current_server -> old_Sdsk_stats[w].io_bcnt)) /
(time_window));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
10 * (((float) (current_server -> Sdsk_stats[w].io_resp - current_server -> old_Sdsk_stats[w].io_resp) -
(float) (current_server -> Sdsk_stats[w].io_act - current_server -> old_Sdsk_stats[w].io_act)) /
(float) (current_server -> Sdsk_stats[w].io_cnt - current_server -> old_Sdsk_stats[w].io_cnt)));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
10 * ((float) (current_server -> Sdsk_stats[w].io_act - current_server -> old_Sdsk_stats[w].io_act) /
(float) (current_server -> Sdsk_stats[w].io_cnt - current_server -> old_Sdsk_stats[w].io_cnt)));
x += (FWIDTH * 10);
y += +fheight;
}
}
}
if (current_server -> got_scsi_tape_stats)
{
for (w = 0; w < 4; w++)
{
if (((current_server -> Stp_stats[w].io_cnt - current_server -> old_Stp_stats[w].io_cnt) > 0) &&
((current_server -> Stp_stats[w].io_act - current_server -> old_Stp_stats[w].io_act) > 0))
{
busy = (float) (current_server -> Stp_stats[w].io_act - current_server -> old_Stp_stats[w].io_act) /
(current_server -> StatPeriod_msec * current_server -> hz / 1000) * 100.0;
if (busy > 100.0)
busy = 100.0;
time_window = (current_server -> StatPeriod_msec / 1000);
if (time_window <= 0)
time_window = 1;
x = devstats_tlx;
disp_info_text (window, display, gc, DrawAreaXYWH, x, y, pixmap, colorLabel.pixel, "Stp-");
x += (FWIDTH * 8);
disp_long (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%2d", colorNumeric.pixel, w);
x += (FWIDTH * 5);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel, busy);
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (current_server -> Stp_stats[w].io_resp - current_server -> old_Stp_stats[w].io_resp) /
(float) (current_server -> Stp_stats[w].io_act - current_server -> old_Stp_stats[w].io_act));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (current_server -> Stp_stats[w].io_cnt - current_server -> old_Stp_stats[w].io_cnt) /
(time_window));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (ctod (current_server -> Stp_stats[w].io_bcnt - current_server -> old_Stp_stats[w].io_bcnt)) /
(time_window));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
10 * (((float) (current_server -> Stp_stats[w].io_resp - current_server -> old_Stp_stats[w].io_resp) -
(float) (current_server -> Stp_stats[w].io_act - current_server -> old_Stp_stats[w].io_act)) /
(float) (current_server -> Stp_stats[w].io_cnt - current_server -> old_Stp_stats[w].io_cnt)));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
10 * ((float) (current_server -> Stp_stats[w].io_act - current_server -> old_Stp_stats[w].io_act) /
(float) (current_server -> Stp_stats[w].io_cnt - current_server -> old_Stp_stats[w].io_cnt)));
x += (FWIDTH * 10);
y += +fheight;
}
}
}
if (current_server -> got_scsi_rom_stats)
{
for (w = 0; w < 4; w++)
{
if (((current_server -> Srom_stats[w].io_cnt - current_server -> old_Srom_stats[w].io_cnt) > 0) &&
((current_server -> Srom_stats[w].io_act - current_server -> old_Srom_stats[w].io_act) > 0))
{
busy = (float) (current_server -> Srom_stats[w].io_act - current_server -> old_Srom_stats[w].io_act) /
(current_server -> StatPeriod_msec * current_server -> hz / 1000) * 100.0;
if (busy > 100.0)
busy = 100.0;
time_window = (current_server -> StatPeriod_msec / 1000);
if (time_window <= 0)
time_window = 1;
x = devstats_tlx;
disp_info_text (window, display, gc, DrawAreaXYWH, x, y, pixmap, colorLabel.pixel, "Srom-");
x += (FWIDTH * 8);
disp_long (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%2d", colorNumeric.pixel, w);
x += (FWIDTH * 5);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel, busy);
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (current_server -> Srom_stats[w].io_resp - current_server -> old_Srom_stats[w].io_resp) /
(float) (current_server -> Srom_stats[w].io_act - current_server -> old_Srom_stats[w].io_act));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (current_server -> Srom_stats[w].io_cnt - current_server -> old_Srom_stats[w].io_cnt) /
(time_window));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (ctod (current_server -> Srom_stats[w].io_bcnt - current_server -> old_Srom_stats[w].io_bcnt)) /
(time_window));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
10 * (((float) (current_server -> Srom_stats[w].io_resp - current_server -> old_Srom_stats[w].io_resp) -
(float) (current_server -> Srom_stats[w].io_act - current_server -> old_Srom_stats[w].io_act)) /
(float) (current_server -> Srom_stats[w].io_cnt - current_server -> old_Srom_stats[w].io_cnt)));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
10 * ((float) (current_server -> Srom_stats[w].io_act - current_server -> old_Srom_stats[w].io_act) /
(float) (current_server -> Srom_stats[w].io_cnt - current_server -> old_Srom_stats[w].io_cnt)));
x += (FWIDTH * 10);
y += +fheight;
}
}
}
if (current_server -> got_esdi_disk_stats)
{
for (w = 0; w < 4; w++)
{
if (((current_server -> esdi_disk_stats[w].io_cnt - current_server -> old_esdi_disk_stats[w].io_cnt) > 0) &&
((current_server -> esdi_disk_stats[w].io_act - current_server -> old_esdi_disk_stats[w].io_act) > 0))
{
busy = (float) (current_server -> esdi_disk_stats[w].io_act - current_server -> old_esdi_disk_stats[w].io_act) /
(current_server -> StatPeriod_msec * current_server -> hz / 1000) * 100.0;
if (busy > 100.0)
busy = 100.0;
time_window = (current_server -> StatPeriod_msec / 1000);
if (time_window <= 0)
time_window = 1;
x = devstats_tlx;
disp_info_text (window, display, gc, DrawAreaXYWH, x, y, pixmap, colorLabel.pixel, "esdi-");
x += (FWIDTH * 8);
disp_long (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%2d", colorNumeric.pixel, w);
x += (FWIDTH * 5);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel, busy);
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (current_server -> esdi_disk_stats[w].io_resp - current_server -> old_esdi_disk_stats[w].io_resp) /
(float) (current_server -> esdi_disk_stats[w].io_act - current_server -> old_esdi_disk_stats[w].io_act));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (current_server -> esdi_disk_stats[w].io_cnt - current_server -> old_esdi_disk_stats[w].io_cnt) /
(time_window));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (ctod (current_server -> esdi_disk_stats[w].io_bcnt - current_server -> old_esdi_disk_stats[w].io_bcnt)) /
(time_window));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
10 * (((float) (current_server -> esdi_disk_stats[w].io_resp - current_server -> old_esdi_disk_stats[w].io_resp) -
(float) (current_server -> esdi_disk_stats[w].io_act - current_server -> old_esdi_disk_stats[w].io_act)) /
(float) (current_server -> esdi_disk_stats[w].io_cnt - current_server -> old_esdi_disk_stats[w].io_cnt)));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
10 * ((float) (current_server -> esdi_disk_stats[w].io_act - current_server -> old_esdi_disk_stats[w].io_act) /
(float) (current_server -> esdi_disk_stats[w].io_cnt - current_server -> old_esdi_disk_stats[w].io_cnt)));
x += (FWIDTH * 10);
y += +fheight;
}
}
}
if (current_server -> got_wd_disk_stats)
{
for (w = 0; w < 4; w++)
{
if (((current_server -> wd_disk_stats[w].io_cnt - current_server -> old_wd_disk_stats[w].io_cnt) > 0) &&
((current_server -> wd_disk_stats[w].io_act - current_server -> old_wd_disk_stats[w].io_act) > 0))
{
busy = (float) (current_server -> wd_disk_stats[w].io_act - current_server -> old_wd_disk_stats[w].io_act) /
(current_server -> StatPeriod_msec * current_server -> hz / 1000) * 100.0;
if (busy > 100.0)
busy = 100.0;
time_window = (current_server -> StatPeriod_msec / 1000);
if (time_window <= 0)
time_window = 1;
x = devstats_tlx;
disp_info_text (window, display, gc, DrawAreaXYWH, x, y, pixmap, colorLabel.pixel, "wd-");
x += (FWIDTH * 8);
disp_long (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%2d", colorNumeric.pixel, w);
x += (FWIDTH * 5);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel, busy);
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (current_server -> wd_disk_stats[w].io_resp - current_server -> old_wd_disk_stats[w].io_resp) /
(float) (current_server -> wd_disk_stats[w].io_act - current_server -> old_wd_disk_stats[w].io_act));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (current_server -> wd_disk_stats[w].io_cnt - current_server -> old_wd_disk_stats[w].io_cnt) /
(time_window));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (ctod (current_server -> wd_disk_stats[w].io_bcnt - current_server -> old_wd_disk_stats[w].io_bcnt)) /
(time_window));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
10 * (((float) (current_server -> wd_disk_stats[w].io_resp - current_server -> old_wd_disk_stats[w].io_resp) -
(float) (current_server -> wd_disk_stats[w].io_act - current_server -> old_wd_disk_stats[w].io_act)) /
(float) (current_server -> wd_disk_stats[w].io_cnt - current_server -> old_wd_disk_stats[w].io_cnt)));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
10 * ((float) (current_server -> wd_disk_stats[w].io_act - current_server -> old_wd_disk_stats[w].io_act) /
(float) (current_server -> wd_disk_stats[w].io_cnt - current_server -> old_wd_disk_stats[w].io_cnt)));
x += (FWIDTH * 10);
y += +fheight;
}
}
}
if (current_server -> got_cart_tape_stats)
{
for (w = 0; w < 4; w++)
{
if (((current_server -> cart_tape_stats[w].io_cnt - current_server -> old_cart_tape_stats[w].io_cnt) > 0) &&
((current_server -> cart_tape_stats[w].io_act - current_server -> old_cart_tape_stats[w].io_act) > 0))
{
busy = (float) (current_server -> cart_tape_stats[w].io_act - current_server -> old_cart_tape_stats[w].io_act) /
(current_server -> StatPeriod_msec * current_server -> hz / 1000) * 100.0;
if (busy > 100.0)
busy = 100.0;
time_window = (current_server -> StatPeriod_msec / 1000);
if (time_window <= 0)
time_window = 1;
x = devstats_tlx;
disp_info_text (window, display, gc, DrawAreaXYWH, x, y, pixmap, colorLabel.pixel, "ct-");
x += (FWIDTH * 8);
disp_long (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%2d", colorNumeric.pixel, w);
x += (FWIDTH * 5);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel, busy);
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (current_server -> cart_tape_stats[w].io_resp - current_server -> old_cart_tape_stats[w].io_resp) /
(float) (current_server -> cart_tape_stats[w].io_act - current_server -> old_cart_tape_stats[w].io_act));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (current_server -> cart_tape_stats[w].io_cnt - current_server -> old_cart_tape_stats[w].io_cnt) /
(time_window));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (ctod (current_server -> cart_tape_stats[w].io_bcnt - current_server -> old_cart_tape_stats[w].io_bcnt)) /
(time_window));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
10 * (((float) (current_server -> cart_tape_stats[w].io_resp - current_server -> old_cart_tape_stats[w].io_resp) -
(float) (current_server -> cart_tape_stats[w].io_act - current_server -> old_cart_tape_stats[w].io_act)) /
(float) (current_server -> cart_tape_stats[w].io_cnt - current_server -> old_cart_tape_stats[w].io_cnt)));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
10 * ((float) (current_server -> cart_tape_stats[w].io_act - current_server -> old_cart_tape_stats[w].io_act) /
(float) (current_server -> cart_tape_stats[w].io_cnt - current_server -> old_cart_tape_stats[w].io_cnt)));
x += (FWIDTH * 10);
y += +fheight;
}
}
}
if (current_server -> got_floppy_disk_stats)
{
for (w = 0; w < 4; w++)
{
if (((current_server -> floppy_disk_stats[w].io_cnt - current_server -> old_floppy_disk_stats[w].io_cnt) > 0) &&
((current_server -> floppy_disk_stats[w].io_act - current_server -> old_floppy_disk_stats[w].io_act) > 0))
{
busy = (float) (current_server -> floppy_disk_stats[w].io_act - current_server -> old_floppy_disk_stats[w].io_act) /
(current_server -> StatPeriod_msec * current_server -> hz / 1000) * 100.0;
if (busy > 100.0)
busy = 100.0;
time_window = (current_server -> StatPeriod_msec / 1000);
if (time_window <= 0)
time_window = 1;
x = devstats_tlx;
disp_info_text (window, display, gc, DrawAreaXYWH, x, y, pixmap, colorLabel.pixel, "fl-");
x += (FWIDTH * 8);
disp_long (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%2d", colorNumeric.pixel, w);
x += (FWIDTH * 5);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel, busy);
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (current_server -> floppy_disk_stats[w].io_resp - current_server -> old_floppy_disk_stats[w].io_resp) /
(float) (current_server -> floppy_disk_stats[w].io_act - current_server -> old_floppy_disk_stats[w].io_act));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (current_server -> floppy_disk_stats[w].io_cnt - current_server -> old_floppy_disk_stats[w].io_cnt) /
(time_window));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
(float) (ctod (current_server -> floppy_disk_stats[w].io_bcnt - current_server -> old_floppy_disk_stats[w].io_bcnt)) /
(time_window));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
10 * (((float) (current_server -> floppy_disk_stats[w].io_resp - current_server -> old_floppy_disk_stats[w].io_resp) -
(float) (current_server -> floppy_disk_stats[w].io_act - current_server -> old_floppy_disk_stats[w].io_act)) /
(float) (current_server -> floppy_disk_stats[w].io_cnt - current_server -> old_floppy_disk_stats[w].io_cnt)));
x += (FWIDTH * 10);
disp_float (window, display, gc, DrawAreaXYWH, pixmap, x, y, "%7.2f", colorNumeric.pixel,
10 * ((float) (current_server -> floppy_disk_stats[w].io_act - current_server -> old_floppy_disk_stats[w].io_act) /
(float) (current_server -> floppy_disk_stats[w].io_cnt - current_server -> old_floppy_disk_stats[w].io_cnt)));
x += (FWIDTH * 10);
y += +fheight;
}
}
}
} /* end of update_dev_stats */
/*+-------------------------------------------------------------------------
draw_dev_stats_literals(x,y)
--------------------------------------------------------------------------*/
void
draw_dev_stats_literals (SP)
struct NetworkXswStruct *SP;
{
Window window = SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].window;
Display *display = SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].display;
GC gc = SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].gc;
XWindowAttributes DrawAreaXYWH = SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].DrawAreaXYWH;
Pixmap pixmap = SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].pixmap;
int x = 0;
int y = 0;
int x2 = x;
int ys = y + FASCENT;
int yl1 = y + (FASCENT / 2) + 1;
int yl2 = y + (FHEIGHT / 2);
int len;
char *cptr;
int fheight = FHEIGHT;
int fwidth = FWIDTH;
int line_style = LineSolid;
int cap_style = CapButt;
int join_style = JoinMiter;
devstats_tlx = x;
devstats_tly = y;
/* the "background" color */
XSetForeground (display, gc, colorTitleBarBG.pixel);
XSetLineAttributes (display, gc, fheight,
line_style, cap_style, join_style);
/*
XDrawLine (display, window, gc, x, yl2, DrawAreaXYWH.width - BORDER_EXTRA_WIDTH , yl2);
*/
XDrawLine (display, pixmap, gc, x, yl2, SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].width - BORDER_EXTRA_WIDTH, yl2);
XSetForeground (display, gc, colorTitleBarFG.pixel);
XSetLineAttributes (display, gc, FASCENT / 2,
line_style, cap_style, join_style);
cptr = "Device # %Busy AvQue r+w/s blcks/s AvWait AvServ ";
/*
XDrawString (display, window, gc, x2, ys, cptr, len = strlen (cptr));
XDrawString (display, window, gc, x2 + 1, ys, cptr, len);
*/
XDrawString (display, pixmap, gc, x2, ys, cptr, len = strlen (cptr));
XDrawString (display, pixmap, gc, x2 + 1, ys, cptr, len);
x2 += (fwidth * len) + FGAP + 1;
/*
XDrawLine (display, window, gc, x2, yl1, DrawAreaXYWH.width - BORDER_EXTRA_WIDTH , yl1);
*/
XDrawLine (display, pixmap, gc, x2, yl1, SP -> SEPERATE_WINDOWS_LIST[BUTTON_dev_stats].width - BORDER_EXTRA_WIDTH, yl1);
} /* end of draw_streams_literals */
/* vi: set tabstop=4 shiftwidth=4: */
/* end of sysinfo.c */